package com.gxa.admin.controller;


import com.gxa.common.vo.JsonResult;
import com.gxa.common.vo.PageRecv;
import com.gxa.common.vo.ResultVo;
import com.gxa.modules.pojo.LoanSearch;
import com.gxa.modules.pojo.Loanafter_Interestrate_Change;
import com.gxa.modules.pojo.Loanafter_Warning;
import com.gxa.modules.service.Loanafter_Interestrate_ChangeService;
import com.gxa.modules.service.Loanafter_WarningService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "数据test",tags = "贷后管理——利率变更——张剑宇")
@RestController


//@RequiresPermissions("/home/afterloan/rate")
@RequestMapping("/loanafter")
public class Loanafter_Interestrate_ChangeController {

    @Autowired(required = false)
    private Loanafter_Interestrate_ChangeService loanafter_interestrate_changeService;

    @PostMapping("/loanafter_inerestrate_change/add")
    @ApiOperation(value = "增加利率变更",notes = "利率变更实体",httpMethod = "POST", response = ResultVo.class)

    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=400,message="坏请求"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=405,message="Method请求错误"),
            @ApiResponse(code=500,message="后台服务错误")
    })

    public ResultVo add(@RequestBody @ApiParam(name = "loanafter_interestrate_change",value = "利率变更实体",required = true) Loanafter_Interestrate_Change loanafter_interestrate_change){

        ResultVo r=loanafter_interestrate_changeService.addChange(loanafter_interestrate_change);
        return r;
    }
    //2.查询贷后预警
        @PostMapping("/loanafter_inerestrate_change/query")
        @ApiOperation(value = "查询利率变更",notes = "利率变更实体",httpMethod = "POST", response = ResultVo.class)

        @ApiResponses({
                @ApiResponse(code=200,message="请求成功"),
                @ApiResponse(code=400,message="坏请求"),
                @ApiResponse(code=404,message="找不到页面"),
                @ApiResponse(code=405,message="Method请求错误"),
                @ApiResponse(code=500,message="后台服务错误")
        })

        public JsonResult query(@RequestBody @ApiParam(name = "pageRecv",value = "贷后预警报告实体",required = true) PageRecv<LoanSearch> pageRecv){

            JsonResult r=loanafter_interestrate_changeService.queryChange(pageRecv);
            return r;
        }
//
//    //3.修改贷后预警
//    @PostMapping("/loanafter_warning/update")
//    @ApiOperation(value = "增加贷后检查报告",notes = "贷后检查报告实体",httpMethod = "POST", response = ResultVo.class)
//
//    @ApiResponses({
//            @ApiResponse(code=200,message="请求成功"),
//            @ApiResponse(code=400,message="坏请求"),
//            @ApiResponse(code=404,message="找不到页面"),
//            @ApiResponse(code=405,message="Method请求错误"),
//            @ApiResponse(code=500,message="后台服务错误")
//    })
//
//    public ResultVo update(@RequestBody @ApiParam(name = "loanafter_warning",value = "贷后预警报告实体",required = true) Loanafter_Warning loanafter_warning){
//
//        ResultVo r=loanafter_WarningService.upadeWarning(loanafter_warning);
//        return r;
//    }
}
